*** Settings ***
Library           RequestsLibrary
Resource           ../common/common.robot
Library           JSONLibrary

*** Keywords ***
Save Design Order
    [Arguments]     ${data}
    Create Session    save_design_order    ${host}
    ${header}    Create Header
    ${response}    POST On Session    save_design_order    /api/admin/design/order/add.ac    json=${data}    headers=${header}
    Should Be Equal As Numbers    ${response.json()['status']}    200
    Should Be Equal As Strings    ${response.json()['message']}    OK
    RETURN  ${response.json()['data']}

Get Design Order
    [Arguments]     ${design_id}
    Create Session    get_design_order    ${host}
    ${header}    Create Header
    ${params}    Create Dictionary    designOrderId=${design_id}
    ${response}    POST On Session    get_design_order   /api/admin/design/order/getDesignOrder.ac    params=${params}    headers=${header}
    Should Be Equal As Numbers    ${response.json()['status']}    200
    Should Be Equal As Strings    ${response.json()['message']}    OK
    RETURN  ${response.json()['data']}
